package com.zhkj.txg.module.product.adapter

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.zhkj.txg.R
import com.zhkj.txg.module.product.entity.CommentEntity
import com.zhkj.txg.utils.ImageUtils

class ProductCommentAdapter :
    BaseQuickAdapter<CommentEntity, BaseViewHolder>(R.layout.item_product_comment_item) {
    override fun convert(helper: BaseViewHolder, item: CommentEntity) {
        val imageView = helper.setText(R.id.tvProductCommentName, item.nickname)
            .setText(R.id.tvProductCommentContent, item.content)
            .getView<ImageView>(R.id.ivProductComment)
        ImageUtils.loadRoundCornerImage(context, imageView, item.avatar)
    }
}